package com.patterns.proxy.commonDynamicProxy;

import com.patterns.proxy.commonDynamicProxy.proxy.SubjectDynamicProxy;
import com.patterns.proxy.commonDynamicProxy.subject.RealSubject;
import com.patterns.proxy.commonDynamicProxy.subject.Subject;

/**
 * Created by Xiao Yiyun on 2017/4/24.
 * 耦合具体业务的动态代理的场景类
 */
public class SubjectClient {
    public static void main(String[] args) {
        //定义一个主题
        Subject subject = new RealSubject(); 
        //定义主题的代理
        Subject proxy = SubjectDynamicProxy.newProxyInstance(subject);
        //代理的行为
        proxy.someMethods("Finish");
    }
}
